﻿
@{
    ViewBag.Title = "project_business";
    Layout = "~/Views/Shared/Index.cshtml";
}

@model List<YaYun.Models.project_business>

<h2>项目业务</h2>

<table class="layui-table layui-form">
    <tr>
        <th class="emp_id_td">序号</th>
        <th class="emp_tr_t">所属部门项目</th>
        <th class="emp_tr_t">业务名称</th>
        <th class="emp_tr_t">业务描述</th>
        <th class="emp_tr_t">业务进度</th>
        <th class="emp_tr_t">业务开始日期 </th>
        <th class="emp_tr_t">业务结束日期</th>
        <th class="emp_tr_t">创建时间</th>
        <th class="emp_tr_t">更新时间</th>

    </tr>
    @foreach (var item in Model)
    {
        <tr class="tr_hover">
            <td class="emp_id_td">@item.id</td>
            @{ 
                var project = "";
                if (item.project_id == 1)
                {
                    project = "人力资源部";
                }
                else if (item.project_id == 2)
                {
                    project = "市场部";
                }
                else if (item.project_id == 3)
                {
                    project = "财务部";
                }
                else if (item.project_id == 4)
                {
                    project = "技术部";
                }
                else if (item.project_id == 5)
                {
                    project = "客服部";
                }
                else if (item.project_id == 6)
                {
                    project = "销售部";
                }
                else if (item.project_id == 7)
                {
                    project = "采购部";
                }
                else if (item.project_id == 8)
                {
                    project = "行政部";
                }
                else if (item.project_id == 9)
                {
                    project = "研发部";
                }
                else if (item.project_id == 10)
                {
                    project = "运营部";
                }
            }
            <td class="emp_tr_t">@project</td>
            <td class="emp_tr_t">@item.business_name</td>
            <td class="emp_tr_t">@item.business_description</td>
            <td class="emp_tr_t">@(item.is_completed==false?"未完成": "已完成")</td>
            <td class="emp_tr_t">@item.start_date</td>
            <td class="emp_tr_t">@item.end_date</td>
            <td class="emp_tr_t">@item.created_at</td>
            <td class="emp_tr_t">@item.updated_at</td>
        </tr>
    }

</table>



<div class="page_item">
    @Html.ActionLink("上一页", "project_business", new { page = ViewBag.CurrentPage - 1 })
    @for (int i = 1; i <= ViewBag.TotalPages; i++)
    {
        if (i == ViewBag.CurrentPage)
        {
            @Html.Label($"{@i}") ;
        }
        else
        {
            @Html.ActionLink(i.ToString(), "project_business", new { page = i })
        }
    }
    @Html.ActionLink("下一页", "project_business", new { page = ViewBag.CurrentPage + 1 })
</div>